// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAmCsm35c9uk538om7dr3mVRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT_xT02o6W2wEvXo-vUKLSlAs1YGA" type="text/javascript"></script>

function notify(flash_message)
{
    // jQuery: reference div, load in message, and fade in
    var flash_div = $("#flash")
    flash_div.html(flash_message);
    flash_div.fadeIn(400);
    // use Javascript timeout function to delay calling
    // our jQuery fadeOut, and hide
    setTimeout(function(){
        flash_div.fadeOut(800,
                function(){
                    flash_div.html("");
                    flash_div.hide()})},
            1400);
}
$(function(){ // &lt;&lt;JQUERY after dom is loaded event
    // hide our container div

    $("#flash").hide();
    // grab flash message from our div
    var flash_message = $("#flash").html().trim();
    // call our flash display function
    if(flash_message != "")
    {
        notify(flash_message);

    }
});

$(document).ready(function() {
    var contentId = window.location.hash || "tabOverview";
    //alert (contentId);
    chgClass(contentId);

    showAddress('1000 Garlands Lane, Barrington, IL 60010');
});

$(window).unload(function() {
GUnload();
});




var map = null;
var geocoder = null;

function initialize() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);
    geocoder = new GClientGeocoder();
  }
}

function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(
      address,
      function(point) {
        if (!point) {
          alert(address + " not found");
        } else {
          map.setCenter(point, 13);
          var marker = new GMarker(point);
          map.addOverlay(marker);
          marker.openInfoWindowHtml(address);
        }
      }
    );
  }
}